package com.dm.sevices;

import com.dm.dao.DmItemCinemaMapper;
import com.dm.pojo.DmItemCinema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by dm
 */
@RestController
public class RestDmItemCinemaService {

     @Autowired
     private DmItemCinemaMapper dmItemCinemaMapper;

     @RequestMapping(value = "/getDmItemCinemaById",method = RequestMethod.POST)
     public DmItemCinema getDmItemCinemaById(@RequestParam("id") Long id)throws Exception{
        return dmItemCinemaMapper.getDmItemCinemaById(id);
     }

     @RequestMapping(value = "/getDmItemCinemaListByMap",method = RequestMethod.POST)
     public List<DmItemCinema>	getDmItemCinemaListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmItemCinemaMapper.getDmItemCinemaListByMap(param);
     }

     @RequestMapping(value = "/getDmItemCinemaCountByMap",method = RequestMethod.POST)
     public Integer getDmItemCinemaCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmItemCinemaMapper.getDmItemCinemaCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddDmItemCinema",method = RequestMethod.POST)
     public Integer qdtxAddDmItemCinema(@RequestBody DmItemCinema dmItemCinema)throws Exception{
        dmItemCinema.setCreatedTime(new Date());
        return dmItemCinemaMapper.insertDmItemCinema(dmItemCinema);
     }

     @RequestMapping(value = "/qdtxModifyDmItemCinema",method = RequestMethod.POST)
     public Integer qdtxModifyDmItemCinema(@RequestBody DmItemCinema dmItemCinema)throws Exception{
        dmItemCinema.setUpdatedTime(new Date());
        return dmItemCinemaMapper.updateDmItemCinema(dmItemCinema);
     }
}
